package edu.rmit.domain;

import java.io.Serializable;
import java.util.Calendar;

/**
 * This class represend a forum message. Which is published under an group. And
 * anyone who participant into this group will can see this message item.
 * 
 * @author Joey George
 * @version 1.0
 * 
 */
@SuppressWarnings("serial")
public class Message implements Serializable {

	/**
	 * ID of the message in database
	 */
	private int id;

	/**
	 * Interest group of the message.
	 */
	private int groupId;

	/**
	 * Speaker of the message.
	 */
	private String speakerName;

	/**
	 * Content of the message.
	 */
	private String content;

	/**
	 * Time of the message.
	 */
	private Calendar createTime;

	/**
	 * The message is active or not.
	 */
	private boolean isActive;

	/**
	 * The constructor without parameter.
	 */
	public Message() {
	}

	/**
	 * * The constructor of the Group object.
	 * 
	 * @param content
	 *            The message's content.
	 * @param groupId
	 *            The group id which this message is belonged to.
	 * @param isActive
	 *            Whether the group is currently active.
	 * @param speakerName
	 *            This message's publisher.
	 * @param time
	 *            The time when this message is published.
	 */
	public Message(String content, int groupId, boolean isActive,
			String speakerName, Calendar time) {
		this.content = content;
		this.groupId = groupId;
		this.isActive = isActive;
		this.speakerName = speakerName;
		this.createTime = time;
	}

	/**
	 * Set the id parameter.
	 * 
	 * @param id
	 *            The id need to be setted.
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @return the group
	 */
	public int getGroupId() {
		return groupId;
	}

	/**
	 * @param group
	 *            the group to set
	 */
	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}

	/**
	 * @return the speaker
	 */
	public String getSpeakerName() {
		return speakerName;
	}

	/**
	 * @param speaker
	 *            the speaker to set
	 */
	public void setSpeakerName(String speakerName) {
		this.speakerName = speakerName;
	}

	/**
	 * @return the content
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param content
	 *            the content to set
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return the time
	 */
	public Calendar getCreateTime() {
		return createTime;
	}

	/**
	 * @param createTime
	 *            the time to set
	 */
	public void setCreateTime(Calendar createTime) {
		this.createTime = createTime;
	}

	/**
	 * @return the isActive
	 */
	public boolean isActive() {
		return isActive;
	}

	/**
	 * @param isActive
	 *            the isActive to set
	 */
	public void setActive(boolean isActive) {
		this.isActive = isActive;
	}
}
